package org.ozsoft.texasholdem.bots;
import java.util.*;
import org.ozsoft.texasholdem.Action;

public class ActionNode 
{
	private ActionNode parent;
	private List<ActionNode> children;
	private int depth;
	private Action action;
	private boolean finalNode;
	private double EHS;
	
	public ActionNode(ActionNode parent, Action action)
	{
		this.parent = parent;
		if(parent == null)
			depth = 0;
		else
			depth = parent.getDepth()+1;
		children = null;
		this.action = action;
		finalNode = false;
	}
	public void setEHS(double EHS)
	{
		this.EHS = EHS;
	}
	public double getEHS()
	{
		return EHS;
	}
	public ActionNode getParent()
	{
		return parent;
	}
	public List<ActionNode> getChildren()
	{
		return children;
	}
	public ActionNode addChild(Action action)
	{
		ActionNode actionNode = new ActionNode(this,action);
		children.add(actionNode);
		return actionNode;
	}
	public int getDepth()
	{
		return depth;
	}
	public boolean compareTo(Action action)
	{
		return this.action.equals(action);
	}
}
